package com.dundun.pattern.interpreter;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class InterpreterMain {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(
                new InputStreamReader(InterpreterMain.class.getResourceAsStream("program.txt")));
        String text;
        while ((text = reader.readLine()) != null) {
            System.out.println("text = '" + text + "'");
            Node node = new ProgramNode();
            node.parse(new Context(text));
            System.out.println("node = " + node);
        }
        reader.close();
    }
}
